<template>
<div class="body">
   <div class="header">
       <div @click="$router.go(-1)" class="left"><img src="" alt=""></div>
       <div class="title">设置</div>

   </div>
   <div class="center">

   </div>
   <div @click="show=true" class="footer">
   <van-action-sheet class="outconfirm" v-model="show" :actions="actions" @select="onSelect"/>
     退出登录
   </div>

</div>
</template>

<script>
export default {
    data(){
        return{
            show: false,
         actions: [
        { name: '是否退出卖座电影网？' },
        { name: '退出' },
        { name: '取消' },

      ]

        }
    },
    methods:{
        loginOut(){
            localStorage.removeItem('status')
            this.$store.commit('removeStatus')
            this.$router.go(-1)
        },
         onSelect(item) {
             if(item.name=='退出'){
      this.loginOut()
      this.show = false;
             }
             if(item.name=='取消'){
      this.show = false;
             }
      // 默认情况下，点击选项时不会自动关闭菜单
      // 可以通过 close-on-click-action 属性开启自动关闭
    }
    }
}
</script>

<style lang="scss" scoped>
.outconfirm{
    background-color: #f4f4f4;
    :nth-child(1) span{
        font-size:0.2rem;
        color:#ff5f16;
    }
    :nth-child(3){
        margin-top:0.3rem;
    }
}

.body{
    height:100%;
    display:flex;
    flex-direction: column;
    background-color: #f4f4f4;
}
.header{
    height:0.88rem;
    background-color:white;
    .left{
        float:left;
        width:1.125rem;
        height:0.88rem;
        margin-left:0.3rem;
        img{
                    float:left;

            width:0.22rem;
            height:0.36rem;
            margin-top:0.3rem;
        }
    }
    .title{
        float:left;
        width:4.65rem;
        height:0.88rem;
        text-align: center;
        line-height: 0.88rem;
        font-size:0.3rem;
    }
}
.center{
    flex:1;
    overflow: hidden;
}

.footer{
    height:0.98rem;
    background-color:white;
    line-height: 0.98rem;
    text-align: center;
    color:#ff5f16;
    font-size:0.3rem;
}


</style>